<template>
  <!-- 面包屑导航 -->
  <el-breadcrumb separator-class="el-icon-arrow-right">
    <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
    <el-breadcrumb-item>文件管理</el-breadcrumb-item>
    <el-breadcrumb-item>分享文件</el-breadcrumb-item>
  </el-breadcrumb>

  <!-- 内容区域 -->
  <el-card class="box-card">
    <!-- 搜索条件 -->
    <el-row :gutter="20">
      <el-col :span="8">
        <el-input placeholder="请输入用户名" v-model="queryParams.titleName">
          <template #append>
            <el-button icon="Search" @click="search(1)" />
          </template>
        </el-input>
      </el-col>
      <el-col :span="4">
        <el-button type="primary" @click="clearSearch">搜索</el-button>
        <el-button type="danger" @click="searchComments">删除</el-button>
      </el-col>
    </el-row>

    <el-table :data="files" style="width: 100%">
      <el-table-column type="selection" width="10"></el-table-column>
      <el-table-column prop="shareId" label="分享ID" width="100"></el-table-column>
      <el-table-column prop="shareLink" label="分享链接" width="150"></el-table-column>
      <el-table-column prop="userId" label="用户ID" width="100"></el-table-column>
      <el-table-column prop="fileId" label="文件ID" width="100"></el-table-column>
      <el-table-column prop="code" label="提取码" width="100"></el-table-column>
      <el-table-column prop="expireTime" label="过期时间(天)" width="150"></el-table-column>
      <el-table-column prop="deletedTime" label="创建时间" width="150"></el-table-column>
      <el-table-column prop="updatedTime" label="更新时间" width="150"></el-table-column>
      <el-table-column prop="status" label="链接状态" width="100"></el-table-column>
    </el-table>

    <!-- 分页组件 -->
    <el-pagination background layout="total, sizes, prev, pager, next, jumper" :total="total"
      :current-page="queryParams.pageNum" :page-sizes="[1, 5, 10]" :page-size="queryParams.pageSize"
      @size-change="handleSizeChange" @current-change="handlePageChange" />
  </el-card>
</template>

<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();

// 查询参数
const queryParams = ref({
  content: '',
  status: '',
  pageNum: 1,
  pageSize: 5
});
// 查询结果
const fileList = ref([]);
const total = ref(0);




</script>

<style scoped>
.box-card {
  margin-top: 20px;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border: 1px solid #ccc;
}

/* 富文本编辑器样式 */
#introEditor {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
}
</style>